//Expects a document with two NMR Spectrums, one 1D and one 2D. Sets both traces of the 2D to be the 1D spectrum
function setTraces() 
{
	var actWindow = mainWindow.activeWindow();
	var curPage = actWindow.curPage();
	var numberOfNMRItems = actWindow.itemCount("NMR Spectrum");
	if(numberOfNMRItems == 2) //to avoid more checks only works with 2 NMR Items in the document
	{
		var spc2D = undefined;
		var spc1D = undefined;

		var firstItem = new NMRSpectrum(actWindow.item(0,"NMR Spectrum"));
		if(firstItem.dimCount == 1)
			spc1D = firstItem;
		else
			spc2D = firstItem;

		var secondItem = new NMRSpectrum(actWindow.item(1, "NMR Spectrum"));
		if(secondItem.dimCount == 1)
			spc1D = secondItem;
		else
			spc2D = secondItem;

		if(spc2D != undefined && spc1D != undefined)
		{
			spc2D.setTrace(spc1D, true);//sets horizontal trace
			spc2D.setTrace(spc1D, false);//sets vertical trace
			spc2D.update();
			curPage.update();
			actWindow.update();
		}
	}
}